/**
 * 超过字符限制的部分显示...
 */

import { _decorator, Component, Node, Label } from 'cc';
import { BCTools } from '../../utils/BCTools';
const { ccclass, property, menu } = _decorator;

@ccclass('BCLabel')
@menu("BC/BCLabel")
export class BCLabel extends Label {
	@property
	private m_enabelSubShow: boolean = false;

	@property({ visible() { return this.m_enabelSubShow }})
	private m_stringLength: number = 0;

	get string(): string{
		return this._string;
	}
    set string(value: string){
		if (this.m_enabelSubShow){
			value = BCTools.subStringShow(value, this.m_stringLength);
		}
		this._string = value;
		this.markForUpdateRenderData(true);
	}
}

